home *** CD-ROM | disk | FTP | other *** search
/ PC/CD Gamer UK 120 / CD Gamer Issue 120 (March 2003) (Disc 2).ISO / mods / Q2_Codered / codeRED1_0.exe / Data1.cab / ref.h < prev    next >
Encoding:
C/C++ Source or Header  |  2002-12-07  |  4.6 KB  |  189 lines

  1. /*
  2. Copyright (C) 1997-2001 Id Software, Inc.
  3.  
  4. This program is free software; you can redistribute it and/or
  5. modify it under the terms of the GNU General Public License
  6. as published by the Free Software Foundation; either version 2
  7. of the License, or (at your option) any later version.
  8.  
  9. This program is distributed in the hope that it will be useful,
  10. but WITHOUT ANY WARRANTY; without even the implied warranty of
  11. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  
  12.  
  13. See the GNU General Public License for more details.
  14.  
  15. You should have received a copy of the GNU General Public License
  16. along with this program; if not, write to the Free Software
  17. Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
  18.  
  19. */
  20. #ifndef __REF_H
  21. #define __REF_H
  22.  
  23. #include "../qcommon/qcommon.h"
  24.  
  25. #define    MAX_DLIGHTS            32
  26. #define MAX_STAINS            32
  27. #define    MAX_ENTITIES        128
  28. #define    MAX_PARTICLES        8192
  29. #define    MAX_LIGHTSTYLES        256
  30.  
  31. #define POWERSUIT_SCALE        4.0F
  32.  
  33. #define SHELL_RED_COLOR        0xF2
  34. #define SHELL_GREEN_COLOR    0xD0
  35. #define SHELL_BLUE_COLOR    0xF3
  36.  
  37. #define SHELL_RG_COLOR        0xDC
  38. //#define SHELL_RB_COLOR        0x86
  39. #define SHELL_RB_COLOR        0x68
  40. #define SHELL_BG_COLOR        0x78
  41.  
  42. //ROGUE
  43. #define SHELL_DOUBLE_COLOR    0xDF // 223
  44. #define    SHELL_HALF_DAM_COLOR    0x90
  45. #define SHELL_CYAN_COLOR    0x72
  46. //ROGUE
  47.  
  48. #define SHELL_WHITE_COLOR    0xD7
  49.  
  50.  
  51. #define PARTICLE_NONE                0
  52. #define PARTICLE_EXPLOSION            1
  53. #define PARTICLE_GREEN_BLOOD        2
  54. #define PARTICLE_BLASTER            3
  55. #define PARTICLE_BLOOD                4
  56. #define PARTICLE_GUNSHOT            5
  57. #define PARTICLE_HEATBEAM            6
  58. #define PARTICLE_SMOKE                7
  59. #define PARTICLE_GREEN_LASER1        8
  60. #define PARTICLE_LEADER_BLAST        9
  61. #define PARTICLE_GREEN_LASER2        10
  62. #define PARTICLE_BLASTER_MZFLASH    11
  63. #define PARTICLE_LEADER_FIELD        12
  64. #define PARTICLE_STEAM                13
  65. #define PARTICLE_LIGHTNING            14
  66. #define PARTICLE_BLASTER_BEAM        15
  67. #define PARTICLE_SMOKE2                16
  68.  
  69. typedef struct entity_s
  70. {
  71.     struct model_s        *model;            // opaque type outside refresh
  72.     float                angles[3];
  73.  
  74.     /*
  75.     ** most recent data
  76.     */
  77.     float                origin[3];        // also used as RF_BEAM's "from"
  78.     int                    frame;            // also used as RF_BEAM's diameter
  79.  
  80.     /*
  81.     ** previous data for lerping
  82.     */
  83.     float                oldorigin[3];    // also used as RF_BEAM's "to"
  84.     int                    oldframe;
  85.  
  86.     /*
  87.     ** misc
  88.     */
  89.     float    backlerp;                // 0.0 = current, 1.0 = old
  90.     int        skinnum;                // also used as RF_BEAM's palette index
  91.  
  92.     int        lightstyle;                // for flashing entities
  93.     float    alpha;                    // ignore if RF_TRANSLUCENT isn't set
  94.  
  95.     struct image_s    *skin;            // NULL for inline skin
  96.     int        flags;
  97. } entity_t;
  98.  
  99. #define ENTITY_FLAGS  68
  100.  
  101. typedef struct
  102. {
  103.     vec3_t    origin;
  104.     vec3_t    color;
  105.     float    intensity;
  106. } dlight_t;
  107.  
  108. typedef struct
  109. {
  110.     vec3_t    origin;
  111.     vec3_t    color;
  112.     float    alpha;
  113.     float    intensity;
  114. } stain_t;
  115.  
  116. typedef struct
  117. {
  118.     vec3_t    origin;
  119.     int        color;
  120.     float    alpha;
  121.     int        type;
  122. } particle_t;
  123.  
  124. typedef struct
  125. {
  126.     float        rgb[3];            // 0.0 - 2.0
  127.     float        white;            // highest of rgb
  128. } lightstyle_t;
  129.  
  130. typedef struct
  131. {
  132.     int            x, y, width, height;// in virtual screen coordinates
  133.     float        fov_x, fov_y;
  134.     float        vieworg[3];
  135.     float        viewangles[3];
  136.     float        blend[4];            // rgba 0-1 full screen blend
  137.     float        time;                // time is uesed to auto animate
  138.     int            rdflags;            // RDF_UNDERWATER, etc
  139.  
  140.     byte        *areabits;            // if not NULL, only areas with set bits will be drawn
  141.  
  142.     lightstyle_t    *lightstyles;    // [MAX_LIGHTSTYLES]
  143.  
  144.     int            num_entities;
  145.     entity_t    *entities;
  146.  
  147.     int            num_stains;
  148.     stain_t        *stains;
  149.  
  150.     int            num_dlights;
  151.     dlight_t    *dlights;
  152.  
  153.     int            num_particles;
  154.     particle_t    *particles;
  155. } refdef_t;
  156.  
  157.  
  158. void    Draw_GetPicSize (int *w, int *h, char *name);
  159. void    Draw_Pic (int x, int y, char *name);
  160. void    Draw_StretchPic (int x, int y, int w, int h, char *name);
  161. void    Draw_Char (int x, int y, int c);
  162. void    Draw_TileClear (int x, int y, int w, int h, char *name);
  163. void    Draw_Fill (int x, int y, int w, int h, int c);
  164. void    Draw_FadeScreen (void);
  165. void    Draw_StretchRaw (int x, int y, int w, int h, int cols, int rows, byte *data);
  166.  
  167. void    R_BeginFrame( float camera_separation );
  168. void    R_SwapBuffers( int );
  169. void    R_SetPalette ( const unsigned char *palette);
  170.  
  171. struct model_s    *R_RegisterModel (char *name);
  172. struct image_s    *R_RegisterSkin (char *name);
  173. struct image_s    *R_RegisterPic (char *name);
  174.  
  175. void    R_SetSky (char *name, float rotate, vec3_t axis);
  176.  
  177. void    R_BeginRegistration (char *map);
  178. void    R_EndRegistration (void);
  179.  
  180. void    R_RenderFrame (refdef_t *fd);
  181. void    R_EndFrame (void);
  182.  
  183. int        R_Init( void *hinstance, void *hWnd );
  184. void    R_Shutdown (void);
  185.  
  186. void    R_AppActivate( qboolean active );
  187.  
  188. #endif // __REF_H
  189.